const Base = require('../../base.js');

module.exports = class extends Base {
  async indexAction() {
    let id = this.get('id')
    if (!id) return this.fail(-1, '参数错误')

    let userInfo = await this.session('user_info')
    if (!userInfo) return this.fail(-1, '未登录')
    
    let task_result = await this.model('task_result/index').getUserResult(userInfo._id, id)

    this.json({
      status: 200, message: 'success', data: task_result
    })
  }
};
